﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Love.Awesome.SimpleTiledImplementation
{
    public class Properties : IDictionary<string, float>
    {
        private Dictionary<string, float> _dic;
        public Properties()
        {
            _dic = new Dictionary<string, float>();
        }

        public float this[string key] { get => ((IDictionary<string, float>)_dic)[key]; set => ((IDictionary<string, float>)_dic)[key] = value; }

        public ICollection<string> Keys => ((IDictionary<string, float>)_dic).Keys;

        public ICollection<float> Values => ((IDictionary<string, float>)_dic).Values;

        public int Count => ((ICollection<KeyValuePair<string, float>>)_dic).Count;

        public bool IsReadOnly => ((ICollection<KeyValuePair<string, float>>)_dic).IsReadOnly;

        public void Add(string key, float value) => ((IDictionary<string, float>)_dic).Add(key, value);
        public void Add(KeyValuePair<string, float> item) => ((ICollection<KeyValuePair<string, float>>)_dic).Add(item);
        public void Clear() => ((ICollection<KeyValuePair<string, float>>)_dic).Clear();
        public bool Contains(KeyValuePair<string, float> item) => ((ICollection<KeyValuePair<string, float>>)_dic).Contains(item);
        public bool ContainsKey(string key) => ((IDictionary<string, float>)_dic).ContainsKey(key);
        public void CopyTo(KeyValuePair<string, float>[] array, int arrayIndex) => ((ICollection<KeyValuePair<string, float>>)_dic).CopyTo(array, arrayIndex);
        public IEnumerator<KeyValuePair<string, float>> GetEnumerator() => ((IEnumerable<KeyValuePair<string, float>>)_dic).GetEnumerator();
        public bool Remove(string key) => ((IDictionary<string, float>)_dic).Remove(key);
        public bool Remove(KeyValuePair<string, float> item) => ((ICollection<KeyValuePair<string, float>>)_dic).Remove(item);
        public bool TryGetValue(string key, out float value) => ((IDictionary<string, float>)_dic).TryGetValue(key, out value);
        IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)_dic).GetEnumerator();
    }
}
